package com.xtq.countclass.dao;

import com.xtq.countclass.entity.Groupe;
import com.xtq.countclass.entity.Record;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.data.domain.Pageable;

import java.util.List;

/**
 * (Record)表数据库访问层
 *
 * @author makejava
 * @since 2024-03-11 22:43:19
 */
public interface RecordDao {
	
	/**
	 * 通过ID查询单条数
	 * @return 实例对象
	 */
	@Select("select * from record where scoreChange!=0")
	List<Record> queryAll();
	
	/**
	 * 新增数据
	 *
	 * @param record 实例对象
	 * @return 影响行数
	 */
	@Insert("insert into record (groupName, username, scoreChange, updatedTime, score,msg) VALUES (#{groupname}, #{username}, #{scorechange}, NOW(), #{score},#{msg})")
	int insert(Record record);
	
	@Select("select * from record where groupName  like CONCAT('%', #{key}, '%') and scoreChange!=0")
	List<Record> queryByKey(String key);
	
	
	
	
	
	
}
